/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bio.jpa.session;

import com.bio.jpa.entities.File;
import java.util.List;
import javax.ejb.Asynchronous;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Diego
 */
@Stateless
public class FileFacade extends AbstractFacade<File> {

    @PersistenceContext(unitName = "BioDeskPU")
    private EntityManager em;
        
    protected EntityManager getEntityManager() {
        return em;
    }

    public List<File> findByprojectPrjId(Integer id) {
        Query q = getEntityManager().createNamedQuery("File.findByprojectPrjId");
        q.setParameter("prjId", id);
        List<File> u = q.getResultList();
        return u;
    }

    public FileFacade() {
        super(File.class);
    }
}
